package com.android.takeaway.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MyDBOpenHelper extends SQLiteOpenHelper {
    // 数据库文件名为takeaway.db，版本号为1
    public MyDBOpenHelper(Context context) {
        super(context, "takeaway.db", null, 1);
    }


    public static final String CREATE_TABLE_USER = "create table User ("
            + "account text primary key,"
            + "password text)";

    public static final String CREATE_TABLE_ORDER = "create table MyOrder ("
            + "account text,"
            + "number text primary key,"
            + "date text,"
            + "shop text,"
            + "price text,"
            + "content text)";


    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_TABLE_USER);
        db.execSQL(CREATE_TABLE_ORDER);
    }


    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
